﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>稿源管理</title>
<script type="text/javascript" src="../../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../../_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="../../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../../style/global.css" />
<script type="text/javascript" src="../../../admin/otherpage/styles/common.js"></script>
<link type="text/css" rel="stylesheet" href="../../../admin/otherpage/styles/common.css" />
<script type="text/javascript">
var state = joinValue('state');
var locked = joinValue('locked');
var pagesize=10;
var page=thispage();
function ajaxList(currentpage)
{
	//设置选项卡
	for(i=0; i<4; i++)
	{
		$$("tab"+i).className = "";
        
	}

	if(state == "&state=0")
		$$("tab0").className = "active";
	else if(state == "&state=1")
		$$("tab1").className = "active";
	else if(state == "&state=2")
		$$("tab2").className = "active";
	else
		$$("tab3").className = "active";
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"../adminsource/ajax.aspx?oper=ajaxGetList"+state+locked,
        error:		function(XmlHttpRequest,textStatus, errorThrown) { alert(XmlHttpRequest.responseText);},
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.LoginUrl + "';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: true});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
			}
		}
	});
}
function aLoad(s) {
	page = "1";
	if(s == "0")
		state = "&state=0";
	else if(s == "1")
		state = "&state=1";
	else if(s == "2")
		state = "&state=2";
	else
		state = "";
	ajaxList(page);
}
function operater(act,classid){
	var ids = JoinSelect("selectID");
	if(ids=="")
	{
		JumbotCms.Alert("没有任何选择项", "0"); 
		return;
	}
	JumbotCms.Loading.show("正在处理...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+ids+"&tocid="+classid,
		url:		"../admin/ajax.aspx?oper=ajaxBatchOper&act="+act+"&time="+(new Date().getTime()) + ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.LoginUrl + "';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				JumbotCms.Loading.hide();
				ajaxList(page);
				break;
			}
		}
	});
}
    </script>
</head>
<body>
<div class="topnav"> <span class="preload1"></span><span class="preload2"></span>
	<ul id="topnavbar">
		<li class="topmenu"><a href="javascript:void(0);" onclick="JumbotCms.Popup.show('edit.aspx?id=0',-1,-1,true)" id="classadd" class="top_link"><span>增加稿源</span></a> </li>
	</ul>
	<script>
	topnavbarStuHover();
    </script>
</div>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabs_head">
	<tr>
		<td class="actions">
			<table cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td id="tab3"><span onclick="aLoad(' ');">全部稿件</span></td>
					<td id="tab2"><span onclick="aLoad('2');">交稿待审</span></td>
					<td id="tab1"><span onclick="aLoad('1');">正在翻译</span></td>
					<td id="tab0"><span onclick="aLoad('0');">等待接稿</span></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<textarea id="tplList" style="display:none">
<table class="tabs_table" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;">
	<tr>
		<th scope="col" width="*">原文信息</th>
		<th scope="col" style="width:75px;">状态</th>
		<th scope="col" style="width:75px;">类别</th>
		<th scope="col" style="width:35px;">翻译</th>
		<th scope="col" style="width:80px;">操作</th>
	</tr>
	{#foreach $T.table as record}
	<tr onMouseOver="this.style.backgroundColor='F3F7FF'" onMouseOut="this.style.backgroundColor='FFFFFF'">
		<td align="left">
			<strong>标题(外文)：</strong>{$T.record.title2}<br />
			<strong>原作者(外文)：</strong>{$T.record.author2}<br />
			<strong>发布时间：</strong>{$T.record.adddate}
		</td>
		<td align="center">
			{#if $T.record.state == "3"}
			稿件归档
			{#elseif $T.record.state == "2"}
			交稿待审
			{#elseif $T.record.state == "1"}
			正在翻译
			{#else}
			等待接稿
			{#/if}
		</td>
		<td align="center">
			{$T.record.sortname}
		</td>
		<td align="center">
			{#if $T.record.state == "0"}
			{#else}
			<a href="javascript:void(0);" onclick="ajaxAddMessage('{$T.record.userid}','{$T.record.username}')" title="发短信给{$T.record.username}"><img src='{site.Dir}publicstyle/writer.gif' border='0' /></a>
			{#/if}
		</td>
		<td align="center">
			{#if $T.record.state == "0"}
			<a href="javascript:void(0);" onclick="JumbotCms.Popup.show('edit.aspx?id={$T.record.id}'+ccid,-1,-1,true)">修改</a>
			{#else}
			<font color="#CCCCCC">编辑</font>
			{#/if}
			{#if $T.record.state == "0"}
			<a href="javascript:void(0);" onclick="ConfirmDel({$T.record.id})">删除</a>
			{#else}
			<font color="#CCCCCC">删除</font>
			{#/if}
			<br />
			{#if $T.record.state == "2"}
			<a title='下载翻译的稿件并纠错' href='javascript:void(0);' onclick="window.open(site.Dir + 'modules/version/adminsource/proof.aspx?sourceid={$T.record.id}'+ccid)">审稿</a>
			<a title='将稿件编辑后入库' href='../admin/edit.aspx?id=0&sourceid={$T.record.id}{ccid}'>归档</a>
			{#else}
			<font color="#CCCCCC">审稿</font>
			<font color="#CCCCCC">归档</font>
			{#/if}
		</td>
	</tr>
	{#/for}
</table>
</textarea>
<div id="ajaxList"> </div>
<div id="ajaxPageBar" class="pages"> </div>
<script type="text/javascript">ajaxList(page);</script>
</body>
</html>
